/*
 * Copyright (C) 2013 Daniel Treffenstädt <daniel@treffenstaedt.de>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301  USA
 */

#include "OMethods.h"
#include "ODegree.h"

namespace std
{
	#include <cmath>
}

O_START_NAMESPACE

double Methods::sin(Degree deg)
{
	return std::sin(deg.rad());
}

Degree Methods::asin(double r)
{
	return Degree::fromRadian(std::asin(r));
}

double Methods::cos(Degree deg)
{
	return std::cos(deg.rad());
}

Degree Methods::acos(double r)
{
	return Degree::fromRadian(std::acos(r));
}

double Methods::tan(Degree deg)
{
	return std::tan(deg.rad());
}

Degree Methods::atan(double r)
{
	return Degree::fromRadian(std::atan(r));
}

double Methods::pow(double b, double e)
{
	return std::pow(b, e);
}

double Methods::root(double b, double n)
{
	return std::pow(b, 1/n);
}

double Methods::abs(double n)
{
	return std::abs(n);
}

O_END_NAMESPACE
